//package github.kawaiior.yuanchuxiuzhen.common.item.armor;
//
//import github.kawaiior.yuanchuxiuzhen.core.init.ItemInit;
//import net.minecraft.inventory.EquipmentSlotType;
//import net.minecraft.item.IArmorMaterial;
//import net.minecraft.item.crafting.Ingredient;
//import net.minecraft.util.LazyValue;
//import net.minecraft.util.SoundEvent;
//import net.minecraft.util.SoundEvents;
//import net.minecraftforge.api.distmarker.Dist;
//import net.minecraftforge.api.distmarker.OnlyIn;
//
//import java.util.function.Supplier;
//
//public enum ExampleArmorMaterial implements IArmorMaterial {
//
//    EXAMPLE("example", 20, new int[]{2, 5, 6, 4}, 15, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 3.0F, 0.1F, () -> {
//        return Ingredient.fromItems(ItemInit.EXAMPLE_ITEM.get());
//    });
//
//
//    private static final int[] MAX_DAMAGE_ARRAY = new int[]{13, 15, 16, 11};
//    private final String name;  // 名字 ->  渲染身上装备有关。
//    private final int maxDamageFactor;  //和耐久相关
//    private final int[] damageReductionAmountArray; // 护甲值 [3,6,8,3] -》 头 盔甲 腿  jio
//    private final int enchantability; //附魔
//    private final SoundEvent soundEvent;
//    private final float toughness;
//    private final float knockbackResistance; // 击退抗性
//    private final LazyValue<Ingredient> repairMaterial;
//
//    private ExampleArmorMaterial(String name, int maxDamageFactor, int[] damageReductionAmountArray, int enchantability, SoundEvent soundEvent, float toughness, float knockbackResistance, Supplier<Ingredient> repairMaterial) {
//        this.name = name;
//        this.maxDamageFactor = maxDamageFactor;
//        this.damageReductionAmountArray = damageReductionAmountArray;
//        this.enchantability = enchantability;
//        this.soundEvent = soundEvent;
//        this.toughness = toughness;
//        this.knockbackResistance = knockbackResistance;
//        this.repairMaterial = new LazyValue<>(repairMaterial);
//    }
//
//    public int getDurability(EquipmentSlotType slotIn) {
//        return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor;
//    }
//
//    public int getDamageReductionAmount(EquipmentSlotType slotIn) {
//        return this.damageReductionAmountArray[slotIn.getIndex()];
//    }
//
//    public int getEnchantability() {
//        return this.enchantability;
//    }
//
//    public SoundEvent getSoundEvent() {
//        return this.soundEvent;
//    }
//
//    public Ingredient getRepairMaterial() {
//        return this.repairMaterial.getValue();
//    }
//
//    @OnlyIn(Dist.CLIENT)
//    public String getName() {
//        return this.name;
//    }
//
//    public float getToughness() {
//        return this.toughness;
//    }
//
//    /**
//     * Gets the percentage of knockback resistance provided by armor of the material.
//     */
//    public float getKnockbackResistance() {
//        return this.knockbackResistance;
//    }
//}
